const { exec } = require('child_process');
const hrtime = process.hrtime();
exec("react-scripts build", (error, stdout, stderr) => {
  if (error) {
    console.error(`执行出错: ${error}`);
    return;
  }
  console.log(`标准输出：${stdout}`);
  if (stderr) {
    console.error(`标准错误输出: ${stderr}`);
  }
 
  const endTime = process.hrtime(hrtime);
  const timeInMs = (endTime[0] * 1e9 + endTime[1]) / 1e6;
  console.log(`执行时间: ${timeInMs} 毫秒`);
})